#include <bits/stdc++.h>

using namespace std;

int N, M, T;

char grass[1000][1000] = {0};

int res;

int dp[105][105][20];

int x1, y3, x2, y2;

struct Node
{
    int x, y;
    int deepth;
};


void dfs(Node now)
{
    if(now.deepth >= T)
        return;

    if(abs(x2 - now.x) + abs(y2 - now.y) > T - now.deepth)
        return;

    int x, y;

    int sum = 0;

    x = now.x + 1, y = now.y + 0;
    if(x > 0 && x <= N && y >0 
    && y <= M && dp[x][y][now.deepth + 1] == 0)
    { 
        if(x == x2 && y == y2 && now.deepth + 1 == T)
            dp[x][y][now.deepth + 1] = 1;
        else if(grass[x][y] == '*')
            dp[x][y][now.deepth + 1] = 0;
        else if(now.deepth + 1 != T){
            Node temp;
            temp.x = x;
            temp.y = y;
            temp.deepth = now.deepth + 1;
            dfs(temp);
        }  
    }
    sum += dp[x][y][now.deepth + 1];

    x = now.x - 1, y = now.y + 0;
    if(x > 0 && x <= N && y >0 
    && y <= M && dp[x][y][now.deepth + 1] == 0)
    { 
        if(x == x2 && y == y2 && now.deepth + 1 == T)
            dp[x][y][now.deepth + 1] = 1;
        else if(grass[x][y] == '*')
            dp[x][y][now.deepth + 1] = 0;
        else if(now.deepth + 1 != T){
            Node temp;
            temp.x = x;
            temp.y = y;
            temp.deepth = now.deepth + 1;
            dfs(temp);
        }  
    }
    sum += dp[x][y][now.deepth + 1];

    x = now.x, y = now.y + 1;
    if(x > 0 && x <= N && y >0 
    && y <= M && dp[x][y][now.deepth + 1] == 0)
    { 
        if(x == x2 && y == y2 && now.deepth + 1 == T)
            dp[x][y][now.deepth + 1] = 1;
        else if(grass[x][y] == '*')
            dp[x][y][now.deepth + 1] = 0;
        else if(now.deepth + 1 != T){
            Node temp;
            temp.x = x;
            temp.y = y;
            temp.deepth = now.deepth + 1;
            dfs(temp);
        }  
    }
    sum += dp[x][y][now.deepth + 1];

    x = now.x, y = now.y - 1;
    if(x > 0 && x <= N && y >0 
    && y <= M && dp[x][y][now.deepth + 1] == 0)
    { 
        if(x == x2 && y == y2 && now.deepth + 1 == T)
            dp[x][y][now.deepth + 1] = 1;
        else if(grass[x][y] == '*')
            dp[x][y][now.deepth + 1] = 0;
        else if(now.deepth + 1 != T){
            Node temp;
            temp.x = x;
            temp.y = y;
            temp.deepth = now.deepth + 1;
            dfs(temp);
        }  
    }
    sum += dp[x][y][now.deepth + 1];

    dp[now.x][now.y][now.deepth] = sum;
}

int main()
{
    cin >> N >> M >> T;

    memset(dp, 0, sizeof(dp));

    for(int i = 1; i <= N; i++ )
    {
        for(int j = 1; j <= M; j++)
        {
            cin >> grass[i][j];
        }
    }

    cin >> x1 >> y3 >> x2 >> y2;

    Node now;
    now.x = x1;
    now.y = y3;
    now.deepth = 0;

    dfs(now);

    cout << dp[now.x][now.y][now.deepth];
}